//
//  TextClientViewController.m
//  IOS_socketClient
//
//  Created by Maculish Ting on 15/4/30.
//  Copyright (c) 2015年 LYD. All rights reserved.
//

#import "TextClientViewController.h"

@interface TextClientViewController ()<DisplayValueDelegate,UITextFieldDelegate>

@end

@implementation TextClientViewController
@synthesize ipField;
@synthesize portField;
@synthesize textField;

//udp测试接收图片
@synthesize UdpImage;

- (void)viewDidLoad {
    [super viewDidLoad];
    udpSocket=[UdpSingleton shareInstance];
    [udpSocket openUdpServerWithDefault];
    udpSocket.adelegate=self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


//接收数据，展示图片
-(void)displaySendScene:(NSData *)data
{
    UdpImage.image=[UIImage imageWithData:data];
    
    NSString *msg = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    if (msg)
    {
        NSLog(@"%@",msg);
        portField.text=msg;
    }
}

@end
